/*!
\copyright  Copyright (c) 2023 Qualcomm Technologies International, Ltd.\n
            All Rights Reserved.\n
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\file
\brief      USB HID Datalink descriptors for the USB Source LE Audio application
*/

#include "usb_hid_datalink_descriptors.h"
#include "usb_app_source_le_audio.h"

static const uint8 usb_source_le_report_descriptor_hid_datalink[] =
{
    USB_HID_DATALINK_REPORT_DESC_COMMON,

    0x09, 0x03,                         /* Vendor Usage 3 */
    0xA1, 0x01,                         /* Collection (Application) */

    0x09, 0x02,                         /* Vendor Usage 2 */
    0x95,                               /* Report count */
    (HID_REPORTID_CONFIGURE_CMD_DATA_SIZE & 0xff),
    0x85, HID_REPORTID_CONFIGURE_CMD,   /* Report ID */
    0xB1, 0x02,                         /* Feature Report */

    0xC0                                /* End of Collection */
};

/* See the USB HID 1.11 spec section 6.2.1 for description */
static const uint8 usb_source_le_interface_descriptor_hid_datalink[] =
{
    HID_DESCRIPTOR_LENGTH,                  /* bLength */
    B_DESCRIPTOR_TYPE_HID,                  /* bDescriptorType */
    0x11, 0x01,                             /* HID class release number (1.00).
                                             * The 1st and the 2nd byte denotes
                                             * the minor & major Nos respectively
                                             */
    0x00,                                   /* Country code (None) */
    0x01,                                   /* Only one class descriptor to follow */
    B_DESCRIPTOR_TYPE_HID_REPORT,           /* Class descriptor type (HID Report) */
    sizeof(usb_source_le_report_descriptor_hid_datalink), /* Report descriptor length. LSB first */
    0x00                                    /* followed by MSB */
};

const usb_hid_class_desc_t usb_source_le_hid_datalink_class_desc = {
        .descriptor = usb_source_le_interface_descriptor_hid_datalink,
        .size_descriptor = sizeof(usb_source_le_interface_descriptor_hid_datalink)
};

const usb_hid_report_desc_t usb_source_le_hid_datalink_report_desc = {
        .descriptor = usb_source_le_report_descriptor_hid_datalink,
        .size_descriptor = sizeof(usb_source_le_report_descriptor_hid_datalink)
};

const usb_hid_config_params_t usb_source_le_hid_datalink_config = {
        .class_desc = &usb_source_le_hid_datalink_class_desc,
        .report_desc = &usb_source_le_hid_datalink_report_desc,
        .endpoints = usb_hid_datalink_endpoints,
        .num_endpoints = ARRAY_DIM(usb_hid_datalink_endpoints)
};
